﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FightTheDragon.Managers;
using FightTheDragon.GameObjects;
using FightTheDragon.Interface;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace FightTheDragon.States
{
    class GameplayState : BaseState
    {
        private InterfaceManager m_Interface;
        private InputManager m_Input;
        private StateManager m_States;
        private ObjectManager m_Objects;
        private CCamera m_Camera;
        private Player m_Player;
        private Image BackTest;
       
        

        public GameplayState()
        {
            m_Input = null;
            m_Interface = null;
            m_States = null;
           // Gameplay = new Text();
            m_Player = null;
            m_Camera = null;
        }


        void BaseState.Enter()
        {
            m_Input = InputManager.Instance;
            m_Interface = InterfaceManager.Instance;
            m_States = StateManager.Instance;
            m_Objects = ObjectManager.Instance;
            m_Player = Player.Instance;
            m_Camera = CCamera.Instance;
            BackTest = new Image(0, 0, 0, "FtD_BasicBackground", 1.0f, Color.White, 0);
            m_Interface.Add(BackTest);
            m_Objects.Add(m_Player);
            



        }
        void BaseState.Exit()
        {

        }
        bool BaseState.HandleInput()
        {
            if (m_Input.ButtonPressedOnce(Buttons.Start) || m_Input.ButtonPressedOnce(Buttons.Back))
                m_States.ChangeState(new PauseState());



            return false;
        }
        void BaseState.Render()
        {
            m_Interface.Render();
            m_Objects.Render();
        }
        void BaseState.Update(float gTime)
        {
            m_Input.Update();
            m_Objects.Update(gTime);
            m_Interface.Update(gTime);
            m_Camera.Update(gTime);


        }
    }
}
